<%@include file="/WEB-INF/includes/taglibs.jsp"%>
<table class="content">
	<tr>
		<td>
        	<spring:url value="/accounts/${account.id}/accountTransactions" var="form_url"/>
        	<form:form action="${form_url}" method="POST" modelAttribute="schedule">
	        	<table class="form" width="200">
					<tr>
						<th colspan="2">Add new Item</th>
					</tr>
					<c:if test="${not empty errors}">
					    <tr>    
					    	<td colspan="2">
	            				<form:errors cssClass="errors" delimiter="&lt;p/&gt;"/>
	            			</td>
	            		</tr>
	            	</c:if>            
	            	<tr>
						<td>
	                		<label for="_name_id">Name:</label>
	                	</td>
	                	<td>
	                		<form:input cssStyle="width:250px" id="_name_id" maxlength="30" path="name" size="0"/>
	                		<br/>
	                		<form:errors cssClass="errors" id="_name_error_id" path="name"/>
	                	</td>
	                </tr>
	                <tr>
	                	<td>
	                		<label for="_type_id">Type:</label>
	                	</td>
	                	<td>
	                		<form:errors cssClass="errors" id="_type_error_id" path="transactionType"/>
			                <form:select cssStyle="width:250px" id="_type_id" items="${transactionTypes}" path="transactionType"/>
	                	</td>
	                </tr>
	                <tr>
	                	<td>
			                <label for="_amount_id">Amount:</label>
						</td>
						<td>
			             	<form:input cssStyle="width:250px" id="_amount_id" maxlength="30" path="amount" size="0"/>
	                		<br/>
	                		<form:errors cssClass="errors" id="_amount_error_id" path="amount"/>
	                	</td>
	                </tr>
	                <tr>
	                	<td>
	                		<label for="_due_id">Due:</label>
	                	</td>      	
	                	<td>
	                		<form:input cssStyle="width:250px" id="_due_id" maxlength="30" path="start" size="0"/>
			                <br/>
			                <form:errors cssClass="errors" id="_due_error_id" path="start"/>
	                	</td>                	
	                </tr>
	                <tr>
	                	<td colspan="2">
	                		<strong>Recurrence</strong>
	                	</td>                	
	                </tr>
	                <tr>
	                	<td>
			                <label for="_frequency_id">Frequency:</label>
						</td>
						<td>
			                <form:errors cssClass="errors" id="_frequency_error_id" path="frequency"/>
			                <form:select cssStyle="width:250px" id="_frequency_id" items="${frequencyTypes}" path="frequency"/>
						</td>
					</tr>
					<tr>
						<td>
	                		<label for="_occurrences_id">Occurrences:</label>
	                	</td>	
	                	<td>
	                		<form:input cssStyle="width:250px" id="_occurrences_id" maxlength="30" path="remainingOccurrences" size="0"/>
	                		<br/>
	                		<form:errors cssClass="errors" id="_occurrences_error_id" path="remainingOccurrences"/>
	                	</td>
	                </tr>
	                <tr>
	                	<td colspan="2" align="right">
			                <input id="proceed" type="submit" value="Create Item"/>
	                	</td>
	                </tr>
				</table>
				<form:hidden path="account.id"/>
        	</form:form>
		</td>
	</tr>     
</table>